xen/arm: smmu: Set s2cr to type fault when the devices are deassigned
authorRahul Singh <rahul.singh@arm.com>
Thu, 11 Aug 2022 15:42:04 +0000 (16:42 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 24 Aug 2022 08:46:59 +0000 (09:46 +0100)
commitfc151829bac48f05a307bfd5ad450b3c0ae2a808
treeebe15799ee8e2f502ff4e8e2babe2892dd1e6fe5
parent399bcbf281bd936d1eff7f7d1054ab49115c3a44
xen/arm: smmu: Set s2cr to type fault when the devices are deassigned

When devices are deassigned/assigned, SMMU global fault is observed
because SMEs are freed in detach function and not allocated again when
the device is assigned back to the guest.

Don't free the SMEs when devices are deassigned, set the s2cr to type
fault. This way the SMMU will generate a fault if a DMA access is done
by a device not assigned to a guest.

Remove the arm_smmu_master_free_smes() as this is not needed anymore,
arm_smmu_write_s2cr() will be used to set the s2cr to type fault.

Fixes: 0435784cc75d ("xen/arm: smmuv1: Intelligent SMR allocation")
Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/drivers/passthrough/arm/smmu.c